<?php /* Smarty version Smarty-3.1.13, created on 2013-06-09 09:39:59
         compiled from ".\application\templates\catalogue.tpl" */ ?>
<?php /*%%SmartyHeaderCode:2504051a21c8eeb0093-21527793%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '9ff4c53208ca0ee296924621189961241ffdca46' => 
    array (
      0 => '.\\application\\templates\\catalogue.tpl',
      1 => 1370770796,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2504051a21c8eeb0093-21527793',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_51a21c8f42b289_03063975',
  'variables' => 
  array (
    'connecte' => 0,
    'arrayCriteres' => 0,
    'categories' => 0,
    'categorie' => 0,
    'total' => 0,
    'livres' => 0,
    'livre' => 0,
    'pages' => 0,
    'type' => 0,
    'criteres' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_51a21c8f42b289_03063975')) {function content_51a21c8f42b289_03063975($_smarty_tpl) {?><?php  $_config = new Smarty_Internal_Config("test.conf", $_smarty_tpl->smarty, $_smarty_tpl);$_config->loadConfigVars("setup", 'local'); ?>
<?php if ($_smarty_tpl->tpl_vars['connecte']->value=='oui'){?>
    <?php echo $_smarty_tpl->getSubTemplate ("headerConnecter.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('title'=>'foo'), 0);?>

<?php }else{ ?>
    <?php echo $_smarty_tpl->getSubTemplate ("headerDeconnecter.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('title'=>'foo'), 0);?>

<?php }?>

<form id="rechercheLivres" name="rechercheLivres" action="index.php?c=catalogue" method="GET">
    <h2>Recherche de livres...</h2>
    <p>
        <label for="titre">Titre</label>  <input id="titre" name="titre" type="text" value="<?php echo $_smarty_tpl->tpl_vars['arrayCriteres']->value['titre'];?>
"  maxlength="40" />
    </p>
    <p>
        <label for="auteur">Auteur</label>  <input id="auteur" name="auteur" type="text" value="<?php echo $_smarty_tpl->tpl_vars['arrayCriteres']->value['auteur'];?>
"  maxlength="40" />
    </p>
    <p>
        <label for="categorie">Catégorie</label>
        <select name="categorie">
            <option value=""></option>
            <?php  $_smarty_tpl->tpl_vars['categorie'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['categorie']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['categories']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['categorie']->key => $_smarty_tpl->tpl_vars['categorie']->value){
$_smarty_tpl->tpl_vars['categorie']->_loop = true;
?>
                <?php if ($_smarty_tpl->tpl_vars['categorie']->value['id']==$_smarty_tpl->tpl_vars['arrayCriteres']->value['categorie']){?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['categorie']->value['id'];?>
" selected="selected"><?php echo $_smarty_tpl->tpl_vars['categorie']->value['description'];?>
</option>
                <?php }else{ ?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['categorie']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['categorie']->value['description'];?>
</option>
                <?php }?>
            <?php } ?>
        </select>
    </p>   
    <p>
        <input type="hidden" name="c" value="catalogue">
        <input type="hidden" name="a" value="recherche">
        <input type="submit" value="Rechercher" class="bouton" />
    </p>
</form>

<?php if ($_smarty_tpl->tpl_vars['total']->value=='0'){?>
    <h3>La recherche n'a retourné aucun résultat !</h3>
<?php }else{ ?>
    <div id="conteneurListeCreations">
        <table border="10">
            <tr>
                <th>Image</th>
                <th>Détails</th>
            </tr>
            <?php  $_smarty_tpl->tpl_vars['livre'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['livre']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['livres']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['livre']->key => $_smarty_tpl->tpl_vars['livre']->value){
$_smarty_tpl->tpl_vars['livre']->_loop = true;
?>
                <tr>
                    <td><img src="application/images/livres/<?php echo $_smarty_tpl->tpl_vars['livre']->value['image'];?>
" height="150" width="131" border="2"/></td>
                    <td>
                        <table>
                            <tr>
                                <td>ISBN : <?php echo $_smarty_tpl->tpl_vars['livre']->value['isbn'];?>
</td>
                            </tr>
                            <tr>
                                <td>Titre : <?php echo $_smarty_tpl->tpl_vars['livre']->value['titre'];?>
</td>
                            </tr>
                            <tr>
                                <td>Résumé : <?php echo $_smarty_tpl->tpl_vars['livre']->value['resume'];?>
</td>
                            </tr>
                            <tr>
                                <td>Auteur : <?php echo $_smarty_tpl->tpl_vars['livre']->value['auteur'];?>
</td>
                            </tr>
                            <tr>
                                <td>Editeur : <?php echo $_smarty_tpl->tpl_vars['livre']->value['editeur'];?>
</td>
                            </tr>
                            <tr>
                                <td>Prix : <?php echo $_smarty_tpl->tpl_vars['livre']->value['prix'];?>
 €</td>
                            </tr>
                            <?php if ($_smarty_tpl->tpl_vars['connecte']->value=='oui'){?>
                            <tr>
                                <td>
                                    <select id="livre_<?php echo $_smarty_tpl->tpl_vars['livre']->value['id'];?>
" name="livre_<?php echo $_smarty_tpl->tpl_vars['livre']->value['id'];?>
">
                                        <option value="1">1</option>
                                        <option value="2">2</option>
                                        <option value="3">3</option>
                                        <option value="4">4</option>
                                        <option value="5">5</option>
                                        <option value="6">6</option>
                                        <option value="7">7</option>
                                        <option value="8">8</option>
                                        <option value="9">9</option>
                                    </select>
                                    <a href="javascript:ajoutAuPanier('<?php echo $_smarty_tpl->tpl_vars['livre']->value['id'];?>
', '<?php echo $_smarty_tpl->tpl_vars['livre']->value['titre'];?>
', '<?php echo $_smarty_tpl->tpl_vars['livre']->value['isbn'];?>
', '<?php echo $_smarty_tpl->tpl_vars['livre']->value['prix'];?>
');"><img src="application/images/styles/cart.png" alt="Ajouter au panier" /></a>
                                </td>     
                            </tr>
                            <?php }?>
                    </table>
                </td>
            </tr>
                                <?php } ?>
    <table>
        <tr>
                                    <?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['id'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['id']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['name'] = 'id';
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['pages']->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['id']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['id']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['id']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['id']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['id']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['id']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['id']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['id']['total']);
?>
                <td><a href="index.php?c=catalogue&a=<?php echo $_smarty_tpl->tpl_vars['type']->value;?>
<?php echo $_smarty_tpl->tpl_vars['criteres']->value;?>
&page=<?php echo $_smarty_tpl->tpl_vars['pages']->value[$_smarty_tpl->getVariable('smarty')->value['section']['id']['index']];?>
"><?php echo $_smarty_tpl->tpl_vars['pages']->value[$_smarty_tpl->getVariable('smarty')->value['section']['id']['index']];?>
</a></td>
                                    <?php endfor; endif; ?>
        </tr>
    </table>
    </table>
</div>
                                    <?php }?>

                                        <?php echo $_smarty_tpl->getSubTemplate ("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
<?php }} ?>